#!/usr/bin/env python
# -*- coding: utf-8 -*-

# @Time     :2020/09/28
# @Author   :Changshu
# @File     :practice_171.py
# 给定一个Excel表格中的列名称，返回其相应的列序号。

def titleToNumber(s: str) -> int:
	ans=0
	for x in s:
		ans*=26
		ans=ans+(ord(x)-ord('A')+1)
	return ans



if __name__ == '__main__':
	s='ZY'
	print(titleToNumber(s))